<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head>
	<ice:outputStyle href="#{baseMBean.securedOutPutStyleURL}"></ice:outputStyle>
</h:head>
<h:body class="#{baseMBean.securedOutPutBodyClass}">
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_supplier"
		var="msgs_supplier"></f:loadBundle>
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_buyer"
		var="msgs_buyer"></f:loadBundle>
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_common"
		var="msgs_common"></f:loadBundle>
	<c:if test="${baseMBean.menuBarEnabled == 'true'}">
		<h:form id="menuBarForm">
			<icecore:singleSubmit />
			<ice:menuBar styleClass="menuBar">
		        <ice:menuItems value="#{menuBarMBean.menuModel}"/>
		    </ice:menuBar>
	    </h:form>		
	</c:if>
	<h:form id="QuoteTransactionFormID">
		<f:event listener="#{loginMBean.isUserSignedIn}" type="preRenderView"></f:event>
		<div class="page-container">
			<div class="pageHeader">
				<ice:panelGrid columns="2">
					<ice:graphicImage
						url="#{sendQuoteToBuyerMBean.getImageResourceURL('PAGE_HEADER_ICON_QUOTE_TEMPLATE_MASTER')}"></ice:graphicImage>
					<ice:outputLabel
						value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_HEADER_SECTION_TITLE}"
						styleClass="pageHeaderTitleText"></ice:outputLabel>
				</ice:panelGrid>
			</div>
			<center>
				<div>
					<ice:inputHidden
						value="#{sendQuoteToBuyerMBean.quoteTransactionsPojo.buyerMasterPojo.buyerId}"
						id="selectedBuyerID" />
				</div>
				<div class="fieldsContainer">
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_QUOTE_NAME}" />
						<span class="field"> <ice:inputText id="quoteNameID"
								value="#{sendQuoteToBuyerMBean.quoteTransactionsPojo.quoteName}"
								binding="#{sendQuoteToBuyerMBean.widgetQuoteName}"
								required="true" immediate="true">
							</ice:inputText>
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" for="quoteNameID" style="color:red;" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_BUYER_COMPANY}" />
						<span class="field"><ice:inputText
								id="quoteBuyerCompanyNameID" readonly="true"
								binding="#{sendQuoteToBuyerMBean.widgetBuyerCompany}"
								value="#{sendQuoteToBuyerMBean.quoteTransactionsPojo.buyerMasterPojo.companyMasterPojo.companyName}"
								required="true" immediate="true" /> <ice:commandLink
								actionListener="#{sendQuoteToBuyerMBean.actionLookUpBuyer}"
								partialSubmit="true" immediate="true">
								<ice:graphicImage
									url="#{quoteTemplateMasterListMBean.getImageResourceURL('IMG_SEARCH_ICON')}"
									title="#{supplierMsgs.TOOLTIP_ACTION_SELECT_BUYER}" />
							</ice:commandLink> </span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" style="color:red;"
								for="quoteBuyerCompanyNameID" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_ATTACH_QUOTE}" />
						<span class="field"> <ace:fileEntry id="fileAttachmentID"
								immediateValidation="true" maxFileCount="1" immediate="true"
								fileEntryListener="#{sendQuoteToBuyerMBean.actionQuoteAttachmentListener}"
								maxFileSize="6291456"
								maxFileSizeMessage="Submitted file is too large."
								requiredMessage="The file is required to submit this form."
								useOriginalFilename="true" useSessionSubdir="true"
								required="true" />
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" style="color:red;"
								for="fileAttachmentID" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_SEND_EMAIL_NOTIFICATION_TO}" />
						<span class="field"> <ice:inputText
								id="sendNotificationEmailID" readonly="true"
								binding="#{sendQuoteToBuyerMBean.widgetSendEmailNotificationTo}"
								value="#{sendQuoteToBuyerMBean.sendEmailNotificationTo}"
								required="true" immediate="true">
								<f:validator validatorId="emailValidator" />
							</ice:inputText> <ice:commandLink
								actionListener="#{sendQuoteToBuyerMBean.actionLookUpBuyerUserEmail}"
								partialSubmit="true" immediate="true">
								<ice:graphicImage
									url="#{quoteTemplateMasterListMBean.getImageResourceURL('IMG_SEARCH_ICON')}"
									title="#{supplierMsgs.TOOLTIP_ACTION_SELECT_BUYER_USER_EMAIL}" />
							</ice:commandLink>
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" style="color:red;"
								for="sendNotificationEmailID" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_COMMENTS}" />
						<span class="field"> <ice:inputTextarea rows="8" cols="40"
								id="supplierCommentsID"
								binding="#{sendQuoteToBuyerMBean.widgetSellerComments}"
								value="#{sendQuoteToBuyerMBean.quoteTransactionEventsPojo.sellerComments}"
								required="true" immediate="true" />
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" style="color:red;"
								for="supplierCommentsID" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_QUOTE_VALUE}" />
						<span class="field"> <ice:inputText id="quoteValueID"
								binding="#{sendQuoteToBuyerMBean.widgetQuoteValue}"
								value="#{sendQuoteToBuyerMBean.quoteTransactionEventsPojo.quoteValue}"
								required="true" immediate="true" converter="javax.faces.Double">
								<f:convertNumber minFractionDigits="2" />
							</ice:inputText>
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" style="color:red;" for="quoteValueID" /></span>
					</div>
				</div>
				<div>
					<ice:panelGrid columns="3">
						<h:commandButton
							value="#{msgs_supplier.SUPPLIER_FORM_ACTION_SUBMIT}" type="submit"
							action="#{sendQuoteToBuyerMBean.actionSendQuoteToBuyer}"
							styleClass="color green button"></h:commandButton>
						<ice:commandButton
							value="#{msgs_supplier.SUPPLIER_FORM_ACTION_CLEAR}"
							immediate="true"
							actionListener="#{sendQuoteToBuyerMBean.actionClear}"
							styleClass="color green button"></ice:commandButton>
						<ice:commandButton
							value="#{msgs_supplier.SUPPLIER_FORM_ACTION_CANCEL}"
							immediate="true" action="#{sendQuoteToBuyerMBean.actionCancel}"
							styleClass="color green button"></ice:commandButton>
					</ice:panelGrid>
				</div>
			</center>
		</div>
	</h:form>
	<h:form id="lookupFormID">
		<!-- Buyers Lookup Dialog -->
		<ace:dialog id="buyerLookUpDialogID"
			widgetVar="#{sendQuoteToBuyerMBean.lookUpDialogBuyerMaster.dialogId}"
			header="#{supplierMsgs.LOOKUP_HEADER_BUYER_MASTER}" width="400"
			height="250" closable="true" position="center" modal="true">
			<center>
				<ace:dataTable id="buyerMasterTableId1"
					value="#{sendQuoteToBuyerMBean.lookUpDialogBuyerMaster.dataList}"
					var="buyerMaster" paginator="true" paginatorPosition="bottom"
					selectionMode="single"
					emptyMessage="#{msgs_common.DATATABLE_EMPTY_MESSAGE}"
					rowSelectListener="#{sendQuoteToBuyerMBean.lookUpActionSelectBuyer}">
					<ace:column id="companyNameId" styleClass="tr1"
						sortBy="#{buyerMaster.companyMasterPojo.companyName}"
						filterBy="#{buyerMaster.companyMasterPojo.companyName}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_buyer.BUYER_LIST_HEADER_COMPANY_NAME}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{buyerMaster.companyMasterPojo.companyName}" />
					</ace:column>
					<ace:column id="addressLine2Id" styleClass="tr1"
						sortBy="#{buyerMaster.companyMasterPojo.addressLine2}"
						filterBy="#{buyerMaster.companyMasterPojo.addressLine2}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_buyer.BUYER_LIST_HEADER_ADDRESS_LINE2}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{buyerMaster.companyMasterPojo.addressLine2}" />
					</ace:column>
				</ace:dataTable>
			</center>
		</ace:dialog>

		<ace:dialog id="buyerUsersLookUpDialogID"
			widgetVar="#{sendQuoteToBuyerMBean.lookUpDialogBuyerUsersPojo.dialogId}"
			header="#{supplierMsgs.LOOKUP_HEADER_BUYER_USERS}" width="400"
			height="250" closable="true" position="center" modal="true">
			<center>
				<ace:dataTable id="buyerUsersTableId1"
					value="#{sendQuoteToBuyerMBean.lookUpDialogBuyerUsersPojo.dataList}"
					var="buyerUsersPojo" paginator="true" paginatorPosition="bottom"
					selectionMode="single"
					emptyMessage="#{msgs_common.DATATABLE_EMPTY_MESSAGE}"
					rowSelectListener="#{sendQuoteToBuyerMBean.lookUpActionSelectBuyerUser}">
					<ace:column id="companyNameId" styleClass="tr1"
						sortBy="#{buyerUsersPojo.userMasterPojo.userName}"
						filterBy="#{buyerUsersPojo.userMasterPojo.userName}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_buyer.BUYER_USER_LIST_HEADER_USER_NAME}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText value="#{buyerUsersPojo.userMasterPojo.userName}" />
					</ace:column>
					<ace:column id="addressLine2Id" styleClass="tr1"
						sortBy="#{buyerUsersPojo.userMasterPojo.email}"
						filterBy="#{buyerUsersPojo.userMasterPojo.email}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_buyer.BUYER_USER_LIST_HEADER_EMAIL}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText value="#{buyerUsersPojo.userMasterPojo.email}" />
					</ace:column>
				</ace:dataTable>
			</center>
		</ace:dialog>
	</h:form>
</h:body>
</html>
